#!/usr/bin/env python3

import rospy
from DrEmpower_can.msg import set_speed
# import DrEmpower as dr

def callback(data):
    import DrEmpower as dr
    dr.set_speed(id_num=data.id_num, speed=data.speed, param=data.param, mode=data.mode)
    rospy.loginfo("set_speed_node")


def listener():
    rospy.init_node("set_speed", anonymous=True)
    rospy.Subscriber("set_speed", set_speed, callback)
    rospy.spin()


if __name__ == '__main__':
    listener()

